home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C++ / Applications / nanoInstall 1.0 / source / standardgetfile.cp < prev    next >
Text File  |  1996-07-05  |  1KB  |  61 lines

  1.  
  2. #include <Finder.h>
  3. #include <StandardFile.h>
  4. #include <Threads.h>
  5.  
  6. #include "standardfile_.h"
  7. #include "standardgetfile.h"
  8.  
  9. standardgetfile::standardgetfile( OSType thetype, short dlogID)
  10.     : standardfile( dlogID)
  11. {
  12.     setTypes( &thetype, 1);
  13. }
  14.  
  15. standardgetfile::standardgetfile( OSType *thetypes, long numtypes, short dlogID)
  16.     : standardfile( dlogID)
  17. {
  18.     setTypes( thetypes, numtypes);
  19. }
  20.  
  21. standardgetfile::~standardgetfile()
  22. {
  23.     delete theTypes;
  24. }
  25.  
  26. void standardgetfile::changeTypes( OSType *thetypes, long numtypes)
  27. {
  28.     delete theTypes;
  29.     setTypes( thetypes, numtypes);
  30. }
  31.  
  32. Boolean standardgetfile::doIt()
  33. {
  34.     Point where = { -1, -1};
  35.  
  36.     CustomGetFile(
  37.             0L,
  38.             numTypes,
  39.             theTypes,
  40.             (StandardFileReply *)this,
  41.             DLOG_ID,
  42.             where,
  43.             0L,
  44.             0L,
  45.             0L,
  46.             0L,
  47.             (void *)this    // Ptr yourDataPtr
  48.     );
  49.     return sfGood;
  50. }
  51.  
  52. void standardgetfile::setTypes( OSType *thetypes, long numtypes)
  53. {
  54.     theTypes = new OSType[ numtypes];
  55.     numTypes = numtypes;
  56.     for( int i = 0; i < numtypes; i++)
  57.     {
  58.         theTypes[ i] = thetypes[ i];
  59.     }
  60. }
  61.